﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class index : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitWindow();
        }
    }

    private void InitWindow()
    {
        this.ltl1.Text = GetWindowStr(1);
        this.ltl2.Text = GetWindowStr(2);
    }

    private string GetWindowStr(int title)
    {
        string str="";
        CIndex i = new CIndex();
        DataRow r = i.Read(title);
        if (null != r)
        {
            str = "<img src=\"" + r["path"].ToString() + "\" alt=\"\" />";
            if (r["product"].ToString() != "")
            {
                str += "<a href=\"product.aspx?id=" + r["product"].ToString() + "\" target=\"_blank\" >产品详解</a><a href=\"productall.aspx\" target=\"_blank\">产品列表</a>";
            }
        }
        return str;
    }
}